﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WT.ParkingShare
{
    public class TextMultLog: TextBox
    {

        public TextMultLog() {
            this.Multiline = true;
            this.BackColor = Color.Black;
            this.ForeColor = Color.White;
            
        }

        delegate void delegateWriteLog(string log);
        public void writeLog(string log)
        {

            if (this.InvokeRequired)
            {
                delegateWriteLog delLog = new delegateWriteLog(writeLog);
                this.Invoke(delLog, log);
            }
            else {
                this.Text = log + "\r\n\r\n" + this.Text;
            }

        }
        
    }
}
